package com.cloudcross.ssp.model;

import java.io.Serializable;

import org.codehaus.jackson.map.ObjectMapper;

/**
 * 广告CPM CPC
 * 
 * @author 高万超
 * @version V1.0.0 $ 2017年6月30日 下午1:20:31
 */
public class AdsCpmAndCpc implements Serializable {

    /** ID */
    private int id;

    /** ADID */
    private String adid;

    /** MIN CPM */
    private double minCpm;

    /** CPM */
    private double cpm;

    /** CPC */
    private double cpc;

    /**
     * ID的取得
     * 
     * @return int ID
     */
    public int getId() {
        return id;
    }

    /**
     * ID的设定
     * 
     * @param id
     *            ID
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * ADID的取得
     * 
     * @return String ADID
     */
    public String getAdid() {
        return adid;
    }

    /**
     * ADID的设定
     * 
     * @param adid
     *            ADID
     */
    public void setAdid(String adid) {
        this.adid = adid;
    }

    /**
     * MIN CPM的取得
     * 
     * @return double MIN CPM
     */
    public double getMinCpm() {
        return minCpm;
    }

    /**
     * MIN CPM的设定
     * 
     * @param minCpm
     *            MIN CPM
     */
    public void setMinCpm(double minCpm) {
        this.minCpm = minCpm;
    }

    /**
     * CPM的取得
     * 
     * @return double CPM
     */
    public double getCpm() {
        return cpm;
    }

    /**
     * CPM的设定
     * 
     * @param cpm
     *            CPM
     */
    public void setCpm(double cpm) {
        this.cpm = cpm;
    }

    /**
     * CPC的取得
     * 
     * @return double CPC
     */
    public double getCpc() {
        return cpc;
    }

    /**
     * CPC的设定
     * 
     * @param cpc
     *            CPC
     */
    public void setCpc(double cpc) {
        this.cpc = cpc;
    }

    public String toString() {

        try {
            return new ObjectMapper().writeValueAsString(this);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "{}";
    }
}